<div class="content-double content-left">
    
    <h1>Rights</h1>
    
    <div class="frame-input">
        <table class='shaded' style="width: 100%">
        <tbody>
        <?php foreach($this->rights as $right) : ?>
            <tr>
                <th colspan="3">    
                    <b>
                    <?= $this->escape($right->name); ?>
                    </b>
                </th>
                <th style="text-align: center;">
                    <a href="<?= $this->url(array('controller'=>'right', 'action'=>'edit', 'right'=>$right->id)) ?>">
                        Edit
                    </a>
                </th>
            </tr>
            <?php if (!empty($right->description)) : ?>
            <tr>
                <td colspan="4">
                    <em><?= $this->escape($right->description); ?></em>
                </td>
            </tr>
            <?php endif;?>
            <?php foreach ($right->findDependentRowset('User_Model_Resources') as $resource ): ?>
            <tr class="<?= $this->alternator(array("odd","even")); ?>">
                <td><?= $this->escape($resource->module); ?></td>
                <td><?= $this->escape($resource->controller); ?></td>
                <td>
                    <?php if ($resource->action == '*') :?>
                    <strong>All</strong>
                    <?php else: ?>
                    <?= $this->escape($resource->action); ?>
                    <?php endif; ?>
                </td>
                <td style="text-align: center;">
                    <a href="<?= $this->url(array('module' => 'user', 'controller' => 'right', 'action' => 'edit-resource', 'resource' => $resource->id), null, true); ?>">
                        Edit
                    </a>
                </td>
            </tr>
            <?php endforeach; ?>
            <tr class="<?= $this->alternator(array("odd","even")); ?>">
                <td colspan="4" style="text-align: center">  
                    <a href="<?= $this->url(array('module' => 'user', 'controller' => 'right', 'action' => 'create-resource', 'right' => $right->id), null, true) ?>">New Resource</a>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>    
        </table>
    </div>
    
</div>

<div class="content-half content-right">
    <h1>&nbsp;</h1>
    <div class="frame-input">
        <div class="frame-content">
            <div class="button-small">
                <a href="<?= $this->url(array('module' => 'user', 'controller' => 'right', 'action' => 'create'), null, true) ?>">Create Right</a>
            </div>
        </div>
    </div>
    
</div>